﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
using Vit.Web;
using Vit.Web.Models;

namespace Vit.WebSite.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        private Vit.Web.Models.WebSite site;

        public HomeController(Vit.Web.Models.WebSite site)
        {
            this.site = site;
        }

        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to ASP.NET MVC!";
            ViewData.Model = "eee";
            return PartialView();
        }

        public ActionResult About()
        {
            return PartialView();
        }

        public ActionResult Sitemap()
        {
            DirectoryInfo dir = new DirectoryInfo(site.PhysicalRootPath);
            if(dir.Exists)
            {
                ViewData.Model = dir;
            }
            return PartialView();
        }
    }
}
